<!DOCTYPE html>
<html>

	<head>
		<meta charset="UTF-8">
		<title>AngularJS基于MVC复杂操作</title>
		<script type="text/javascript" src="../js/angular.min.js" ></script>
		<script type="text/javascript" src="../js/angular-route.min.js" ></script>
	</head>
	
	<body ng-app="myapp">
		<div>
			<h1>HEAD</h1>
			<ul>
				<li><a href="#/">首页</a></li>
				<li><a href="#/users">用户管理</a></li>
				<li><a href="#/products">商品管理</a></li>
			</ul>			
		</div>
		
		<!--显示不同页面内容 -->
		<!-- ng-view 显示路由调用的页面 -->
		<div ng-view></div>
		
		<div>
			<h1>FOOT</h1>
		</div>
	</body>
	
	<script type="text/javascript">
		var myapp = angular.module("myapp",['ngRoute']);
		myapp.config(["$routeProvider" , function($routeProvider){
			// 设置路由对应页面 
			$routeProvider.when("/", {
				templateUrl: '05_route_1.html'
			}).when("/users", {
				templateUrl: '05_route_2.html'
			}).when("/products", {
				templateUrl: '05_route_3.html'
			}).otherwise({
				redirectTo: '/'
			});
		}]);
	</script>


</html>